<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>css 相关</title>
  <script src="https://cdn.bootcss.com/vue/2.6.11/vue.min.js"></script>
  <style>
    .box {
      border-bottom: 1px solid red;
      margin-bottom: 20px;
      padding-bottom: 5px;
    }
    .tip {
      color: red;
    }
    .f-size {
      font-size: 20px;
    }
    .static1 {
      border: 1px solid;
    }
  </style>
</head>
<body>
  <h1>绑定class和style</h1>
  <div id="app">
    <div class="box">
      <h3>绑定的class</h3>
      <div>
        <span class="static1" :class="{tip: showTip, 'f-size': showSize}">绑定 class</span>
      </div>
    </div>

    <div class="box">
      <h3>绑定style</h3>
      <p :style="{fontSize: fs + 'px'}">p标签</p>
    </div>

  </div>

  <script>
    var vue = new Vue({
      el: "#app",
      data: {
        msg: "Hello, World",
        showTip: false,
        showSize: true,
        fs: 20,
      }
    })
  </script>
</body>
</html>